package com.xhwl.logistics.converter.mapstruct;

import com.xhwl.common.dto.cent.vehicle.feign.VehicleParkingLotQuery;
import com.xhwl.logistics.bo.VehicleParkingLotBO;
import com.xhwl.logistics.bo.VehicleParkingLotSecondBO;
import com.xhwl.logistics.bo.input.QueryVehicleParkingLotBO;
import com.xhwl.logistics.entity.VehicleParkingLot;
import com.xhwl.logistics.vo.VehicleParkingLotVO;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueMappingStrategy;

import java.util.List;
import java.util.stream.Collectors;

@Mapper(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT)
public interface VehicleParkingLotConverter {

    //*********Query BO <- Feign Query*********
    QueryVehicleParkingLotBO vehicleParkingLotQuery2QueryVehicleParkingLotBO(VehicleParkingLotQuery vehicleParkingLotQuery);
    //*********Query BO <- Feign Query*********


    //*********BO <- Entity*********
    default List<VehicleParkingLotBO> toVehicleParkingLotBOList(List<VehicleParkingLot> vehicleParkingLotList, String projectName) {
        return vehicleParkingLotList.stream().map(vehicleParkingLot -> toVehicleParkingLotBO(vehicleParkingLot, projectName)).collect(Collectors.toList());
    }
    VehicleParkingLotBO toVehicleParkingLotBO(VehicleParkingLot vehicleParkingLot, String projectName);

    List<VehicleParkingLotSecondBO> vehicleParkingLotList2VehicleParkingLotSecondBOList(List<VehicleParkingLot> vehicleParkingLotList);
    VehicleParkingLotSecondBO vehicleParkingLot2VehicleParkingLotSecondBO(VehicleParkingLot vehicleParkingLot);
    //*********BO <- Entity*********


    //*********VO <- BO*********
    List<VehicleParkingLotVO> vehicleParkingLotBOList2VehicleParkingLotVOList(List<VehicleParkingLotBO> vehicleParkingLotBOList);
    VehicleParkingLotVO vehicleParkingLotBO2VehicleParkingLotVO(VehicleParkingLotBO vehicleParkingLotBO);
    //*********VO <- BO*********

}
